<template>
  <!-- 定义在这里的参数都是不可在外部覆盖的，防止出现问题 -->
  <j-select-custom-component
    :value="value"
    :ellipsisLength="25"
    :listUrl="url.list"
    :columns="columns"
    v-on="$listeners"
    v-bind="attrs"
    :queryParams="queryParams"
    ref="JSelectCustomComponent"
  />
</template>

<script>

    import JSelectCustomComponent from '@/components/jeecgbiz/JSelectCustomComponent/index'

    export default {
        name: 'JSelectProject',
        components: {JSelectCustomComponent},
        props: {
            projectCode: {
                required: false,
                default: ''
            },
            projectName: {
                required: false,
                default: ''
            },
          value:{
            type:String,
            required:false
          }
        },
        data() {
            return {
                url: {
                    list: '/project/project/list'
                },
                columns: [
                    {title: '项目代码', dataIndex: 'projectCode', align: 'center'},
                    {title: '项目名称', dataIndex: 'projectName', align: 'center'}
                ],
                // 定义在这里的参数都是可以在外部传递覆盖的，可以更灵活的定制化使用的组件
                default: {
                    name: '项目',
                    width: 1200,
                    orgFields: '',
                    destFields: '',
                    displayKey: 'projectCode',
                    returnKeys: ['projectCode', 'projectCode'],
                },
                queryParams: [{
                    label: '项目代码',
                    key: 'projectCode'
                }, {
                    label: '编项目名称号',
                    key: 'projectName',
                }],
            }
        },
        computed: {
            attrs() {
                return Object.assign(this.default, this.$attrs)
            }
        }
    }
</script>

<style lang="less" scoped></style>